package net.entelijan.cobean.examples.lit;

import java.awt.Container;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import net.entelijan.cobean.examples.util.ExamplesUtil;
import net.miginfocom.swing.MigLayout;

public class EditBookDialog extends JDialog {

	
	private JTextField titleTextField = new JTextField();
	private JTextField subtitleTextField = new JTextField();
	private JTextField yearTextField = new JTextField();
	private JCheckBox translationCheckBox = new JCheckBox();

	private JButton okButton = new JButton("OK");
	private JButton cancelButton = new JButton("Cancel");

	private static final long serialVersionUID = 1L;

	public EditBookDialog(JFrame owner) {
		super(owner);
		setTitle("Lit Book");
		Container cp = getContentPane();
		cp.setLayout(new MigLayout());
		cp.add(new JLabel("Title"));
		cp.add(this.titleTextField, "w max, wrap");
		cp.add(new JLabel("Subtitle"));
		cp.add(this.subtitleTextField, "w max, wrap");
		cp.add(new JLabel("Year of Publication"));
		cp.add(this.yearTextField, "w max, wrap");
		cp.add(new JLabel("Translation"));
		cp.add(this.translationCheckBox, "w max, wrap");
		cp.add(new JPanel(), "h max, w max, span 2, wrap");
		add(ExamplesUtil.createButtonsPanel(100, this.okButton,
				this.cancelButton), "w max, span2, wrap");
	}

	public JTextField getTitleTextField() {
		return titleTextField;
	}

	public void setTitleTextField(JTextField titleTextField) {
		this.titleTextField = titleTextField;
	}

	public JTextField getSubtitleTextField() {
		return subtitleTextField;
	}

	public void setSubtitleTextField(JTextField subtitleTextField) {
		this.subtitleTextField = subtitleTextField;
	}

	public JTextField getYearTextField() {
		return yearTextField;
	}

	public void setYearTextField(JTextField yearTextField) {
		this.yearTextField = yearTextField;
	}

	public JCheckBox getTranslationCheckBox() {
		return translationCheckBox;
	}

	public void setTranslationCheckBox(JCheckBox translationCheckBox) {
		this.translationCheckBox = translationCheckBox;
	}

	public JButton getOkButton() {
		return okButton;
	}

	public void setOkButton(JButton okButton) {
		this.okButton = okButton;
	}

	public JButton getCancelButton() {
		return cancelButton;
	}

	public void setCancelButton(JButton cancelButton) {
		this.cancelButton = cancelButton;
	}


}
